package com.dyp.mapstructdemo.service.mapper.selfdefine;

import org.springframework.stereotype.Component;

@Component
public class BooleanToStr {
    public String toStr(Boolean bool){
        if(bool){
            return "Y";
        }
        else
        {
            return "N";
        }
    }

    public Boolean toBool(String str){
        if(str.equalsIgnoreCase("Y")){
            return true;
        }
        else
        {
            return false;
        }
    }
}
